<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
			    xmlns:h="http://java.sun.com/jsf/html"
			    xmlns:f="http://java.sun.com/jsf/core"
			    xmlns:ui="http://java.sun.com/jsf/facelets"
			    xmlns:p="http://primefaces.org/ui" 
				template="/templates/template.xhtml">
	<ui:define name="topo">
		Topo
	</ui:define>
	
	<ui:define name="esquerda">
		<ui:include src="/pages/menuLateral.xhtml"></ui:include>
	</ui:define>
	
	<ui:define name="centro">
	
        <h:form id="conTelemetriaForm">

            <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
                
            <p:panelGrid columns="2" id="panelGrid1">           

                <f:facet name="header"> Telemetria </f:facet>

                <h:outputLabel for="sensor1" value="Valor do sensor 1:" /> 
                <p:inputText id="sensor1" value="#{telemetriaController.telemetria.sensor1}"/>
                
                <h:outputLabel for="sensor2" value="Valor do sensor 2:" /> 
                <p:inputText id="sensor2" value="#{telemetriaController.telemetria.sensor2}"/>
                
                <h:outputLabel for="sensor3" value="Valor do sensor 3:" /> 
                <p:inputText id="sensor3" value="#{telemetriaController.telemetria.sensor3}"/>
                
                <h:outputLabel for="sensor4" value="Valor do sensor 4:" /> 
                <p:inputText id="sensor4" value="#{telemetriaController.telemetria.sensor4}"/>     
                
                </p:panelGrid>

				 <p:poll interval="1" listener="#{telemetriaController.atualizarSensores()}" 
				     update="sensor1, sensor2, sensor3, sensor4" />
				     
				 <p:commandButton id="iniciaContagem" type="button"
				 action="#{telemetriaController.iniciaContagemArduino()}"/>
          
        </h:form>
	</ui:define>
	
	<ui:define name="esquerda">
		<ui:include src="/pages/menuLateral.xhtml"></ui:include>
	</ui:define>
	
	<ui:define name="rodape">
		Rodape
	</ui:define>
</ui:composition>

